#ifndef FIELD1D_H
#define FIELD1D_H

#include <cmath>
#include <vector>
#include <iostream>

#include "../Field/Field.h"
#include "../Tool/Macros.h"

using namespace std;

template<class Type>
class Field1D : public Field<Type>
{

public:
    //Constructor for Field1D: with no input argument
    Field1D();

    Field1D( std::vector<int> dims );

    Field1D( std::vector<int> dims, std::string name );

    ~Field1D();

    void allocate_dims(std::vector<int> dims);


    inline Type& operator () (int i)
    {
        PICDEBUGEXECUTE
        (
            if (i>=dims_[0] || i < 0)
            {
                cout<<"Out of limits & "<<i<<endl;
                return this->data_[0];
            }
        );

        return this->data_[i];
    };

    inline Type operator () (int i) const
    {
        PICDEBUGEXECUTE
        (
            if (i>=dims_[0] || i < 0)
            {
                cout<<"Out of limits & "<<i<<endl;
                return this->data_[0];
            }
        );

        return this->data_[i];
    };

    Field1D& operator=(const Field1D& field1D);

private:
};


#endif
